﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Crm2011.BusinessTransaction
{
    abstract public class BaseProcess
    {
        protected object Data { private set; get; }
        protected ExecutionContext ExecutionContext { private set; get; }

        public BaseProcess(ExecutionContext context, object data)
        {
            this.Data = data;
            this.ExecutionContext = context;
        }

        public void Execute()
        {
            this.ExecutionContext.TracingService.Trace("Executing business process internal logic: " + this.GetType().Name);
            this.ExecutionContext.TracingService.Trace("Current User: " + System.Security.Principal.WindowsIdentity.GetCurrent().Name);

            ExecuteInternal();

        }


        protected abstract void ExecuteInternal();

    }
}
